<?php
use think\facade\Route;
/**
 * 描述:登录
 * 作者:W
 */
Route::post('login', 'Auth/login');
Route::post('refreshToken', 'Auth/refreshToken');

/**
 * 描述:同步角色菜单
 * 作者:W
 */
Route::group(function () {
    Route::get('getAsyncRoutes', 'MenuRoutes/getAsyncRoutes');
    Route::get('menuRoutesList', 'MenuRoutes/menuRoutesList');
})->middleware(\app\middleware\Check::class);

/**
 * 描述:用户管理
 * 作者:W
 */
Route::group(function () {
    Route::post('user', 'User/getUserList');//查询
    Route::post('userSave', 'User/saveUser');//保存
    Route::post('updateStatus', 'User/updateStatus');//更新状态
    Route::delete('user', 'User/deleteUser');//删除
    Route::put('user', 'User/updateUser');//更新
    Route::post('saveUserRole', 'User/saveUserRole');//保存用户角色
    Route::post('resetPassword', 'User/resetPassword');//保存用户角色
})->middleware(\app\middleware\Check::class);

/**
 * 描述:菜单管理
 * 作者:W
 */
Route::group(function () {
    Route::post('menu', 'Menu/menuList');//查询
    Route::put('menu', 'Menu/updateMenu');//更新
    Route::delete('menu', 'Menu/deleteMenu');//删除
    Route::post('saveMenu', 'Menu/saveMenu');//查询

})->middleware(\app\middleware\Check::class);

/**
 * 描述:角色管理
 * 作者:W
 */
Route::group(function () {
    Route::post('roles', 'Roles/getRoleList');//查询
    Route::get('listAllRole', 'Roles/listAllRole');//查询
    Route::post('listRoleIds', 'Roles/listRoleIds');//查询
    Route::put('roles', 'Roles/updateRole');//更新
    Route::delete('roles', 'Roles/deleteRole');//删除
    Route::post('saveRole', 'Roles/addRole');//新增
    Route::post('updateRoleStatus', 'Roles/updateStatus');//更新状态
    Route::post('roleMenu', 'Roles/getRoleMenuList');//获取全部菜单
    Route::post('saveRoleMenu', 'Roles/saveRoleMenu');//新增/更新权限
    Route::post('getRoleMenuIdsById', 'Roles/getRoleMenuIdsById');//获取已有的权限
})->middleware(\app\middleware\Check::class);

/**
 * 描述:部门管理
 * 作者:W
 */
Route::group(function () {
    Route::post('dept', 'Department/departmentList');//查询
    Route::post('addDept', 'Department/addDepartment');//新增
    Route::put('dept', 'Department/updateDepartment');//更新

})->middleware(\app\middleware\Check::class);

